package com.x.attendance.assemble.control;

import com.x.attendance.assemble.control.service.AttendanceSettingService;
import com.x.attendance.assemble.control.task.AttendanceStatisticTask;
import com.x.attendance.assemble.control.task.MobileRecordAnalyseTask;
import com.x.base.core.project.Context;

public class ThisApplication{
	
	protected static Context context;
	
	public static Context context() {
		return context;
	}
	
	public static void init() throws Exception {
		try {
			new AttendanceSettingService().initAllSystemConfig();
			context().schedule( AttendanceStatisticTask.class, "0 0 0/4 * * ?");
			context().schedule( MobileRecordAnalyseTask.class, "0 0 1/4 * * ?");
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	public static void destroy() {
		try {
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}
